<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .woman {
      color: red;
    }
    .man {
      color: blue;
    }
  </style>
</head>
<body>
  <div id="div1"></div>
  <script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
  <script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
  <script src="http://static.runoob.com/assets/react/browser.min.js"></script>
  <script type="text/babel">
    let obj1 = {
      name: 'Jack',
      age: 26,
      sex: 'man'
    }
    let obj2 = {
      name: 'Jane',
      age: 16,
      sex: 'woman'
    }
    let img = './static/login-bg.jpeg';
    let url = './react2.html'
    // 标签属性-变量替换
    // class要写成className！！！
    // style要写成对象
    let node1 = <div>
        <a href={url} style={{color: 'red'}}>去看看react2</a><br />
        <img src={img} alt="" width="200px"/>
        <p className={obj1.sex} style={{fontSize:obj1.age+'px'}}>姓名：{obj1.name}</p>
        <p className={obj2.sex} style={{fontSize:obj2.age+'px'}}>姓名：{obj2.name}</p>
      </div>
    ReactDOM.render(node1, div1);
  </script>
</body>
</html>